#ifndef ZVIEW_APP_HPP
#define ZVIEW_APP_HPP

#include "app/base_app.hpp"
#include "gl/gl_utils.hpp"

#include "stdint.h"

#include "zview_dev/include/ZViewDevice.hpp"

#include <thread>

class ZViewApp final : public App {
public:
    ZViewApp(GLFWwindow *w, const char* name);
    ~ZViewApp();

    void OnInitialize() override;
    void OnCleanup() override;

protected:

    void RenderFrame(double delta_time, double total_time) override;
    void StandaloneUI() override;
    uint32_t UIFlags() const override;

    void OnKey(int key, int modifiers, bool is_press) override;
    void OnWheelScroll(int dx, int dy) override;

private:
    void SpeedTestForH2C();
    void SpeedTestForC2H();

private:
    void* pBuff1;
    void* pBuff2;
    IZViewDevice *pDev;

    std::thread   h2c;
    std::thread   c2h;

    int  test_cycle;
    int  test_size;
    char h2c_result[64];
    char c2h_result[64];
};

#endif// ZVIEW_APP_HPP
